p = [0.1:0.1:1];
t = [];
tUI = [];
tER = [];
tST = [];

load f_tiempos_01;

t01 = [];
t01UI = [];
t01ER = [];
t01ST = [];

x = 1;
y = 1;
z = 1;
for i = 1:length(tiempos(:,1))
	t01(i) = tiempos(:,1)(i);
	if tiempos(:,2)(i) != -1
		t01UI(x) = tiempos(:,2)(i);
		x = x +1;
	endif
	if tiempos(:,3)(i) != -1
		t01ER(y) = tiempos(:,3)(i);
		y = y +1;
	endif
	if tiempos(:,4)(i) != -1
		t01ST(z) = tiempos(:,4)(i);
		z = z +1;
	endif
endfor

t(1) = sum(t01)/length(t01);
tUI(1) = sum(t01UI)/length(t01UI);
tER(1) = sum(t01ER)/length(t01ER);
tST(1) = sum(t01ST)/length(t01ST);

load f_tiempos_02;

t01 = [];
t01UI = [];
t01ER = [];
t01ST = [];

x = 1;
y = 1;
z = 1;
for i = 1:length(tiempos(:,1))
	t01(i) = tiempos(:,1)(i);
	if tiempos(:,2)(i) != -1
		t01UI(x) = tiempos(:,2)(i);
		x = x +1;
	endif
	if tiempos(:,3)(i) != -1
		t01ER(y) = tiempos(:,3)(i);
		y = y +1;
	endif
	if tiempos(:,4)(i) != -1
		t01ST(z) = tiempos(:,4)(i);
		z = z +1;
	endif
endfor

t(2) = sum(t01)/length(t01);
tUI(2) = sum(t01UI)/length(t01UI);
tER(2) = sum(t01ER)/length(t01ER);
tST(2) = sum(t01ST)/length(t01ST);

load f_tiempos_03;

t01 = [];
t01UI = [];
t01ER = [];
t01ST = [];

x = 1;
y = 1;
z = 1;
for i = 1:length(tiempos(:,1))
	t01(i) = tiempos(:,1)(i);
	if tiempos(:,2)(i) != -1
		t01UI(x) = tiempos(:,2)(i);
		x = x +1;
	endif
	if tiempos(:,3)(i) != -1
		t01ER(y) = tiempos(:,3)(i);
		y = y +1;
	endif
	if tiempos(:,4)(i) != -1
		t01ST(z) = tiempos(:,4)(i);
		z = z +1;
	endif
endfor

t(3) = sum(t01)/length(t01);
tUI(3) = sum(t01UI)/length(t01UI);
tER(3) = sum(t01ER)/length(t01ER);
tST(3) = sum(t01ST)/length(t01ST);

load f_tiempos_04;

t01 = [];
t01UI = [];
t01ER = [];
t01ST = [];

x = 1;
y = 1;
z = 1;
for i = 1:length(tiempos(:,1))
	t01(i) = tiempos(:,1)(i);
	if tiempos(:,2)(i) != -1
		t01UI(x) = tiempos(:,2)(i);
		x = x +1;
	endif
	if tiempos(:,3)(i) != -1
		t01ER(y) = tiempos(:,3)(i);
		y = y +1;
	endif
	if tiempos(:,4)(i) != -1
		t01ST(z) = tiempos(:,4)(i);
		z = z +1;
	endif
endfor

t(4) = sum(t01)/length(t01);
tUI(4) = sum(t01UI)/length(t01UI);
tER(4) = sum(t01ER)/length(t01ER);
tST(4) = sum(t01ST)/length(t01ST);

load f_tiempos_05;

t01 = [];
t01UI = [];
t01ER = [];
t01ST = [];

x = 1;
y = 1;
z = 1;
for i = 1:length(tiempos(:,1))
	t01(i) = tiempos(:,1)(i);
	if tiempos(:,2)(i) != -1
		t01UI(x) = tiempos(:,2)(i);
		x = x +1;
	endif
	if tiempos(:,3)(i) != -1
		t01ER(y) = tiempos(:,3)(i);
		y = y +1;
	endif
	if tiempos(:,4)(i) != -1
		t01ST(z) = tiempos(:,4)(i);
		z = z +1;
	endif
endfor

t(5) = sum(t01)/length(t01);
tUI(5) = sum(t01UI)/length(t01UI);
tER(5) = sum(t01ER)/length(t01ER);
tST(5) = sum(t01ST)/length(t01ST);

load f_tiempos_06;

t01 = [];
t01UI = [];
t01ER = [];
t01ST = [];

x = 1;
y = 1;
z = 1;
for i = 1:length(tiempos(:,1))
	t01(i) = tiempos(:,1)(i);
	if tiempos(:,2)(i) != -1
		t01UI(x) = tiempos(:,2)(i);
		x = x +1;
	endif
	if tiempos(:,3)(i) != -1
		t01ER(y) = tiempos(:,3)(i);
		y = y +1;
	endif
	if tiempos(:,4)(i) != -1
		t01ST(z) = tiempos(:,4)(i);
		z = z +1;
	endif
endfor

t(6) = sum(t01)/length(t01);
tUI(6) = sum(t01UI)/length(t01UI);
tER(6) = sum(t01ER)/length(t01ER);
tST(6) = sum(t01ST)/length(t01ST);

load f_tiempos_07;

t01 = [];
t01UI = [];
t01ER = [];
t01ST = [];

x = 1;
y = 1;
z = 1;
for i = 1:length(tiempos(:,1))
	t01(i) = tiempos(:,1)(i);
	if tiempos(:,2)(i) != -1
		t01UI(x) = tiempos(:,2)(i);
		x = x +1;
	endif
	if tiempos(:,3)(i) != -1
		t01ER(y) = tiempos(:,3)(i);
		y = y +1;
	endif
	if tiempos(:,4)(i) != -1
		t01ST(z) = tiempos(:,4)(i);
		z = z +1;
	endif
endfor

t(7) = sum(t01)/length(t01);
tUI(7) = sum(t01UI)/length(t01UI);
tER(7) = sum(t01ER)/length(t01ER);
tST(7) = sum(t01ST)/length(t01ST);

load f_tiempos_08;

t01 = [];
t01UI = [];
t01ER = [];
t01ST = [];

x = 1;
y = 1;
z = 1;
for i = 1:length(tiempos(:,1))
	t01(i) = tiempos(:,1)(i);
	if tiempos(:,2)(i) != -1
		t01UI(x) = tiempos(:,2)(i);
		x = x +1;
	endif
	if tiempos(:,3)(i) != -1
		t01ER(y) = tiempos(:,3)(i);
		y = y +1;
	endif
	if tiempos(:,4)(i) != -1
		t01ST(z) = tiempos(:,4)(i);
		z = z +1;
	endif
endfor

t(8) = sum(t01)/length(t01);
tUI(8) = sum(t01UI)/length(t01UI);
tER(8) = sum(t01ER)/length(t01ER);
tST(8) = sum(t01ST)/length(t01ST);

load f_tiempos_09;

t01 = [];
t01UI = [];
t01ER = [];
t01ST = [];

x = 1;
y = 1;
z = 1;
for i = 1:length(tiempos(:,1))
	t01(i) = tiempos(:,1)(i);
	if tiempos(:,2)(i) != -1
		t01UI(x) = tiempos(:,2)(i);
		x = x +1;
	endif
	if tiempos(:,3)(i) != -1
		t01ER(y) = tiempos(:,3)(i);
		y = y +1;
	endif
	if tiempos(:,4)(i) != -1
		t01ST(z) = tiempos(:,4)(i);
		z = z +1;
	endif
endfor

t(9) = sum(t01)/length(t01);
tUI(9) = sum(t01UI)/length(t01UI);
tER(9) = sum(t01ER)/length(t01ER);
tST(9) = sum(t01ST)/length(t01ST);

load f_tiempos_10;

t01 = [];
t01UI = [];
t01ER = [];
t01ST = [];

x = 1;
y = 1;
z = 1;
for i = 1:length(tiempos(:,1))
	t01(i) = tiempos(:,1)(i);
	if tiempos(:,2)(i) != -1
		t01UI(x) = tiempos(:,2)(i);
		x = x +1;
	endif
	if tiempos(:,3)(i) != -1
		t01ER(y) = tiempos(:,3)(i);
		y = y +1;
	endif
	if tiempos(:,4)(i) != -1
		t01ST(z) = tiempos(:,4)(i);
		z = z +1;
	endif
endfor

t(10) = sum(t01)/length(t01);
tUI(10) = sum(t01UI)/length(t01UI);
tER(10) = sum(t01ER)/length(t01ER);
tST(10) = sum(t01ST)/length(t01ST);

plot(p, tUI, '*-k', p, tER, 'o-k', p, tST, '+-k');
xlabel('p');
ylabel('Tiempo medio en cada cola de una unidad');
legend('Tiempo medio en la cola UI','Tiempo medio en la cola ER','Tiempo medio en la cola ST');
print('tMedioColas.eps', '-deps');

